<?php

use think\migration\Migrator;
use think\migration\db\Column;

class QuitDeposit extends Migrator
{
    public function up()
    {
        $table = $this->table('quit_deposit',array('comment' => '退款表'));
        $table->addColumn('number', 'string', array('limit' => 255, 'default' => '', 'comment' => '退款订单号'))
              ->addColumn('deposit', 'integer', array('default' => 0, 'comment' => '退款金额'))
              ->addColumn('user_id', 'integer', array('comment' => '退款用户id'))
              ->addColumn('describe', 'string', array('limit' => 255, 'default' => '', 'comment' => '退款订单描述'))
              ->addColumn('status', 'integer', array('limit' => 3, 'null'=>true))
              ->addColumn('created_at', 'timestamp', array('default' => 'CURRENT_TIMESTAMP'))
              ->addColumn('updated_at', 'timestamp', array('null' => true))
              ->addIndex('number')
              ->save();   
    }
    public function down()
    {
        $this->dropTable('quit_deposit');
    }
}
